<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\DistributionConfig
 *
 * @property int $id
 * @property float $minimal_withdraw_limit 最低提现金额
 * @property int $highest_level 最高分销等级
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\DistributionConfig newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\DistributionConfig newQuery()
 * @method static \Illuminate\Database\Query\Builder|\App\DistributionConfig onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\DistributionConfig query()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\DistributionConfig whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\DistributionConfig whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\DistributionConfig whereHighestLevel($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\DistributionConfig whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\DistributionConfig whereMinimalWithdrawLimit($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\DistributionConfig whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\DistributionConfig withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\DistributionConfig withoutTrashed()
 * @mixin \Eloquent
 */
class DistributionConfig extends Model
{
    use SoftDeletes;
    public static function getHighestLevel(): int
    {
        $data = self::first();
        return $data ? $data->highest_level : 0;
    }
}
